package cn.wolfcode.service.impl;

import cn.wolfcode.domain.Product;
import cn.wolfcode.mapper.ProductMapper;
import cn.wolfcode.service.IProductService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Description: 生产者业务逻辑实现类
 * @Author: 伍家钰
 * @Date: 2020/8/28 13:13
 * @Version: 1.0
 */
@Service
@Slf4j
public class ProductServiceImpl implements IProductService {

    @Autowired
    private ProductMapper productMapper;

    @Override
    public void save(Product product) {
        //记录调用日志
        log.info("ProductController.get....");
        productMapper.save(product);
    }

    @Override
    public Product get(Long id) {
        //记录调用日志
        log.info("ProductController.get....");
        return productMapper.get(id);
    }
}
